/*
 * This file is part of ddesktop: remote desktop system for iPad 
 *
 * Copyright (C) 2010 Kazuhiro Satoh
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. if not, see <http://www.gnu.org/licenses/>.
 */


#pragma once
#pragma unmanaged


namespace DDesktopServer
{
	class AbstractEncoder
	{
	public:

		virtual ~AbstractEncoder()
		{
		}

		virtual bool Init(int max_width, int max_height) = 0;
		virtual const unsigned char* GetHeader(void) const = 0;
		virtual const unsigned char* GetData(void) const = 0;
		virtual int GetHeaderSize(void) const = 0;
		virtual int GetDataSize(void) const = 0;
		virtual bool Encode(char* data, int width, int height, int canvas_width, int canvas_height, int image_quality, int image_resolution) = 0;
		virtual bool Encode(char* data, int width, int height, int canvas_width, int canvas_height, int image_quality) 
		{
			return Encode(data, width, height, canvas_width, canvas_height, image_quality, 1);
		}

		virtual bool WriteToFile(const char* file_name) const // for debug
		{
			return true;
		}
	};
}

#pragma managed
